package com.zzh.wsss.mapper;

import com.zzh.wsss.pojo.Job;
import com.zzh.wsss.pojo.JobMsg;
import com.zzh.wsss.pojo.User;
import com.zzh.wsss.pojo.UserMsg;
import org.apache.ibatis.annotations.*;

import java.util.List;

public interface JobOperateMapper {

    @Select("select * from job limit #{count} , 8")
    List<Job> getJobs(@Param("count") int count);

    @Select("select count(*) from job")
    Integer getJobNum();

    @Select("select * from job where id=#{jobId}")
    Job getJob(@Param("jobId") Integer jobId);

    @Select("select * from job")
    List<JobMsg> getJobsMsg();

    @Select("select * from job where job_name like '%${search}%'")
    List<JobMsg> getGivenJobsMsg(@Param("search") String search);

    @Insert("insert into job (job_name,introduce,number) values (#{jobName},#{introduce},#{number})")
    void addJob(@Param("jobName") String jobName,@Param("introduce") String introduce,@Param("number") String number);

    @Delete("delete from job where id = #{jobId}")
    void deleteJob(@Param("jobId") int parseInt);

    @Update("update job set job_name=#{jobName} where id=#{jobId}")
    void updataJobName(@Param("jobId") int parseInt,@Param("jobName") String jobName);

    @Update("update job set introduce=#{introduce} where id=#{jobId}")
    void updataJobIntroduce(@Param("jobId") int parseInt, @Param("introduce") String introduce);

    @Update("update job set number=#{number} where id=#{jobId}")
    void updataJobNumber(@Param("jobId") int parseInt,@Param("number") int parseInt1);
}
